package com.linkgie.galaxyframework.templating.model.java;

/**
 * Java 类型的模型；
 * 
 * @author huanghaiquan
 *
 */
public class JavaType {

	/**
	 * 包；
	 */
	private JavaPackage packagee;

	private String name;

	public JavaType() {
	}

	public JavaType(JavaPackage packagee, String name) {
		this.packagee = packagee;
		this.name = name;
	}

	/**
	 * 包；
	 * <p>
	 * 避免和关键字 package 冲突，故采用 packagee ；
	 * 
	 * @return
	 */
	public JavaPackage getPackagee() {
		return packagee;
	}

	public void setPackagee(JavaPackage packagee) {
		this.packagee = packagee;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFullName() {
		return packagee.getName() + "." + name;
	}

	/**
	 * 包的源码路径；
	 * 
	 * @return
	 */
	public String getPackagePath() {
		return packagee.getPath();
	}

	/**
	 * 类型的源码路径；
	 * 
	 * @return
	 */
	public String getTypePath() {
		return String.format("%s/%s.java", getPackagePath(), name);
	}

}
